package cn.iocoder.yudao.module.erp.dal.mysql.bomgroupstandard;

import java.util.*;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.erp.dal.dataobject.bomgroupstandard.BomGroupStandardDO;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.yudao.module.erp.controller.admin.bomgroupstandard.vo.*;

/**
 * bom分组 Mapper
 *
 * @author lekailehuai
 */
@Mapper
public interface BomGroupStandardMapper extends BaseMapperX<BomGroupStandardDO> {

    default List<BomGroupStandardDO> selectList(BomGroupStandardListReqVO reqVO) {
        return selectList(new LambdaQueryWrapperX<BomGroupStandardDO>()
                .likeIfPresent(BomGroupStandardDO::getName, reqVO.getName())
                .eqIfPresent(BomGroupStandardDO::getNumber, reqVO.getNumber())
                .eqIfPresent(BomGroupStandardDO::getDescription, reqVO.getDescription())
                .likeIfPresent(BomGroupStandardDO::getSimplename, reqVO.getSimplename())
                .orderByDesc(BomGroupStandardDO::getId));
    }

	default BomGroupStandardDO selectByParentidAndName(Long parentid, String name) {
	    return selectOne(BomGroupStandardDO::getParentid, parentid, BomGroupStandardDO::getName, name);
	}

    default Long selectCountByParentid(Long parentid) {
        return selectCount(BomGroupStandardDO::getParentid, parentid);
    }

}